package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;
import java.util.Properties;

import javax.swing.JTextField;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;
import javax.swing.JComboBox;

public class AddTopicSubtopic extends JFrame {

	private JPanel contentPane;
	private JTextField topicField;
	private JTextField subField;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AddTopicSubtopic frame = new AddTopicSubtopic(null);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AddTopicSubtopic(Properties languageFile) {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JLabel lblAddTopicAndor = new JLabel(languageFile.getProperty("usr.menu.file.addTopics"));
		lblAddTopicAndor.setFont(new Font("Tahoma", Font.BOLD, 18));
		lblAddTopicAndor.setHorizontalAlignment(SwingConstants.CENTER);
		
		JLabel lblTopic = new JLabel(languageFile.getProperty("usr.menu.file.addTopic.topic"));
		lblTopic.setFont(new Font("Tahoma", Font.BOLD, 15));
		
		topicField = new JTextField();
		topicField.setColumns(10);
		
		JButton btnAddTopic = new JButton(languageFile.getProperty("usr.menu.file.addTopic.addBtn"));
		btnAddTopic.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblChooseTopic = new JLabel(languageFile.getProperty("usr.menu.file.addTopic.chooseTopic"));
		lblChooseTopic.setFont(new Font("Tahoma", Font.BOLD, 15));
		
		JComboBox topicChosen = new JComboBox();
		
		JLabel lblSubtopic = new JLabel(languageFile.getProperty("usr.menu.file.addTopic.subtopic"));
		lblSubtopic.setFont(new Font("Tahoma", Font.BOLD, 15));
		
		subField = new JTextField();
		subField.setColumns(10);
		
		JButton btnAddSubtopic = new JButton(languageFile.getProperty("usr.menu.file.addTopic.addSub"));
		btnAddSubtopic.setFont(new Font("Tahoma", Font.BOLD, 11));
		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
					.addGap(4)
					.addGap(18)
					.addComponent(lblTopic, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_contentPane.createSequentialGroup()
							.addComponent(btnAddTopic, GroupLayout.PREFERRED_SIZE, 99, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(lblSubtopic, GroupLayout.PREFERRED_SIZE, 96, GroupLayout.PREFERRED_SIZE))
						.addGroup(gl_contentPane.createSequentialGroup()
							.addComponent(topicField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addGap(18)
							.addComponent(lblChooseTopic)))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addGap(334)
						.addGroup(gl_contentPane.createSequentialGroup()
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
								.addComponent(subField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(topicChosen, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(btnAddSubtopic))
							.addGap(231)))
					.addGap(4)
					.addGap(46))
				.addGroup(gl_contentPane.createSequentialGroup()
					.addComponent(lblAddTopicAndor, GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE)
					.addGap(270))
		);
		gl_contentPane.setVerticalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addComponent(lblAddTopicAndor)
					.addGap(63)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(topicField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(topicChosen, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblTopic)
						.addComponent(lblChooseTopic))
					.addGap(41)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnAddTopic)
						.addComponent(subField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblSubtopic))
					.addGap(31)
					.addComponent(btnAddSubtopic)
					.addGap(36))
		);
		contentPane.setLayout(gl_contentPane);
	}
}
